Auto merge of #1533 - mohtar:doc-open, r=wycats
authorbors <bors@rust-lang.org>
Sat, 18 Apr 2015 15:20:10 +0000 (15:20 +0000)
committerbors <bors@rust-lang.org>
Sat, 18 Apr 2015 15:20:10 +0000 (15:20 +0000)
commit6882352814f684e588f4d010ad4d8a71be12f98a
treeef57816c10b488708d31239b4003d186b5972418
parent83a6d0ed8208d31a1f6dab5e5183ad9eb2d65eaf
parentdf56a07d8ecfb6bb5b2da405bc8d1bdc588ea128
Auto merge of #1533 - mohtar:doc-open, r=wycats

Since #318, the `doc` command generates documentation for binaries in addition to libraries. But currently running `cargo doc --open` would not launch the browser for binary-only packages, even though it should. This commit changes the logic: binaries will be searched when there are no libraries in the package.

A simple test case:

`Cargo.toml`:

    [package]
    name = "foo"
    version = "0.1.0"
    authors = []

`src/main.rs`:

    pub fn main() {
        println!("Hello, world!");
    }

EDIT: I should add that this should fix #1472